# Maintainer: Cowington Post <cowingtonpost@gmail.com>
pkgname=dbmate
pkgver=2.16.0
pkgrel=0
pkgdesc="Lightweight, framework-agnostic database migration tool"
url="https://github.com/amacneil/dbmate"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="https://github.com/amacneil/dbmate/archive/v$pkgver/dbmate-$pkgver.tar.gz"
options="net"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

prepare() {
	default_prepare
	go mod download
}

build() {
	go build -v
}

check() {
	go test -v
}

package() {
	install -Dm755 dbmate -t "$pkgdir"/usr/bin/

	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/dbmate/
}

sha512sums="
bf056ffd26c087dcafb287de94f97a8fb3ea0db2f74ef830cd34c03fd2d56bdc4c7fe4d768eb44532d18c0a79ed5ccf2243307007b4aaa5766904fd52d3ec452  dbmate-2.16.0.tar.gz
"
